In this paper we identify QD(A,B), the quasidiagonal classes in KK_1(A,B), in terms of K_*(A) and K_*(B), and we use these results in various applications. Here is our central result. Theorem: Suppose that A is in the category of separable nuclear C^*-algebras which satisfy the UCT and A is quasidiagonal relative to B. Then there is a natural isomorphism QD(A,B) = Pext (K_*(A), K_*(B))_0 . Thus quasidiagonality of KK-classes is indeed a topological invariant. We give several applications. Finally, we establish a converse to a theorem of Davidson, Herrero, and Salinas, giving conditions under which the quasidiagonality of A/K implies the quasidiagonality of the associated representation of A.